import request from '@/utils/request'
/**
 *
 * 员工管理
 *
 **/
// 登录、
export const login = (data: any) =>
  request({
    'url': '/employees/login',
    'method': 'post',
    data
  })
  // 退出
 export const userLogout = (params: any) =>
 request({
   'url': `/employees/logout`, // 授课老师接口
   'method': 'post',
   params
 })

export const getEmployeeList = (params: any) => {
  return request({
    url: '/employees/list',
    method: 'get',
    params
  })
}

// 修改---启用禁用接口
export const enableOrDisableEmployee = (params: any) => {
  return request({
    url: '/employees/status',
    method: 'put',
    params: {
      id:params.id,
      status:params.status
    }
  })
}

// 新增---添加员工
export const addEmployee = (params: any) => {
  return request({
    url: '/employees',
    method: 'post',
    data: { ...params }
  })
}

// 修改---添加员工
export const editEmployee = (id: string | (string | null)[],params: any) => {
  return request({
    url: `/employees/${id}`,
    method: 'put',
    data: { ...params }
  })
}

// 修改页面反查详情接口
export const queryEmployeeById = (id: string | (string | null)[]) => {
  return request({
    url: `/employees/${id}`,
    method: 'get'
  })
}
